#pragma once

#include "esp_system.h"
#include "string.h"

#define PAC_PORT0                  0
#define PAC_PORT1                  1

#define PCA_OUTPUT                 0X00
#define PCA_INPUT                  0XFF

#define PAC9535_ADDR                0x20    // 默认地址(假设A0-A2接地)

typedef enum{
    pin0 = 0,
    pin1,
    pin2,
    pin3,
    pin4,
    pin5,
    pin6,
    pin7,
    pinAll,
}PCA_Pin_t;

uint8_t pac9535_get_input(uint8_t port, PCA_Pin_t pin) ;
void pac9535_set_output(uint8_t port, PCA_Pin_t pin, bool state) ;
void pac9535_init(uint8_t port1fun, uint8_t port2fun, uint8_t outlvl) ;


